<!-- 联系我们 -->
<template>
  <div class="">
    <Ueditor v-model="contactUs" editorId="contactUs" />
    <a-button v-has="'system:baseConfig:contactUs:edit'" type="primary" size="large" style="margin-top: 20px" @click="handleSave">保存</a-button>
  </div>
</template>

<script>
import { configApp, saveConfigApp } from '@/api/web/web'
import Ueditor from '@/components/Ueditor'

export default {
  components: {
    Ueditor
  },
  data() {
    return {
      contactUs: undefined,
    }
  },
  computed: {},
  watch: {},
  methods: {
    async getConfigApp() {
      let res = await configApp()
      this.contactUs = res.data.contactUs
    },
    async handleSave() {
      let { code, msg } = await saveConfigApp({ contactUs: this.contactUs })
      this.$message[code === 0 ? 'success' : 'error'](msg)
      if (code === 0) {
        this.getConfigApp()
      }
    }
  },
  created() {
    this.getConfigApp()
  },
  mounted() {}
}
</script>
<style scoped></style>
